//
//  CustomTableCellB.m
//  NewApp
//
//  Created by xueyan liu on 6/22/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CustomTableCellB.h"
#import "NATextImageView.h"

@implementation CustomTableCellB

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //frame.size = CGSizeMake(640, 177);
        // Initialization code
    }
    return self;
}

- (void) setContentWithImage:(NSURL *)image 
                       title:(NSString *)title
                    subtitle:(NSString *)subtitle
                     content:(NSString *)content{
    
    NAImageView *imageView = [[NAImageView alloc] initWithFrame:CGRectMake(12, 10, 90, 70)];
    UIImage *img = [g_imageLoader cachedImageForURL:image target:imageView];
    if (img != nil) {
        [imageView didLoadImage:image Image:img];
    }
    
    [self.contentView addSubview:imageView];
    [imageView release];
    
    
    UILabel *lblTitle = [[UILabel alloc] initWithFrame:CGRectMake(115, 13, 203, 16)];
    lblTitle.text = title;
    lblTitle.textColor = [UIColor whiteColor];
    lblTitle.font = [UIFont fontWithName:@"Arial" size:18];
    [lblTitle setBackgroundColor:[UIColor clearColor]];
    [self.contentView addSubview:lblTitle];
    [lblTitle release];
    
    UILabel *lblSubTitle = [[UILabel alloc] initWithFrame:CGRectMake(115, 35, 203, 16)];
    lblSubTitle.text = subtitle;
    lblSubTitle.textColor = [UIColor whiteColor];
    lblSubTitle.font = [UIFont fontWithName:@"Arial" size:14];
    [lblSubTitle setBackgroundColor:[UIColor clearColor]];
    [self.contentView addSubview:lblSubTitle];
    [lblSubTitle release];
    
    UILabel *lblContent = [[UILabel alloc] initWithFrame:CGRectMake(115, 52, 203, 29)];
    lblContent.text = content;
    lblContent.textColor = [UIColor whiteColor];
    lblContent.font = [UIFont fontWithName:@"Arial" size:14];
    [lblContent setBackgroundColor:[UIColor clearColor]];
    lblContent.numberOfLines = 0;
    lblContent.lineBreakMode = UILineBreakModeCharacterWrap;
    [self.contentView addSubview:lblContent];
    [lblContent release];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
